
#include <ObjBase.h>
#include "plusObj.h"
#include "IPlus_i.c"   //get IID_IPlus
HRESULT __stdcall CPlusObj::QueryInterface(
								 REFIID riid , 
								 void **ppObj)
{
	if (riid == IID_IUnknown)
	{
		*ppObj = static_cast<IPlus*>(this) ; 
		AddRef() ;
		return S_OK;
	}

	if (riid == IID_IPlus)
	{
		*ppObj = static_cast<IPlus*>(this) ;
		AddRef() ;
		return S_OK;
	}

	//
	//if control reaches here then , let the client know that
	//we do not satisfy the required interface
	//

	*ppObj = NULL ;
	return E_NOINTERFACE ;
}

HRESULT __stdcall CPlusObj::setFirtNumber( long nX1)
{
	m_nX = nX1;
	return S_OK;
}
HRESULT __stdcall CPlusObj::setSecondNumber( long nX2)
{
	m_nY = nX2;
	return S_OK;
}
HRESULT __stdcall CPlusObj::DoPlus( long *pBuffer)
{
	*pBuffer = m_nY + m_nX;
	return S_OK;
}
